using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Masood.MobileGames.SlidingLib.Abstract;


namespace Masood.MobileGames.SlidingLib.Box
{
    public class MusicOffButton : AbstractBox
    {
        public MusicOffButton(int width, int height)
            : base(width, height)
        {
        }

        public MusicOffButton(float x, float y, int width, int height)
            : base(x, y, width, height)
        {
        }

        public MusicOffButton(ContentManager content, float x, float y, int width, int height)
            : base(content, x, y, width, height)
        {

        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
            Texture2D texture = content.Load<Texture2D>("music.off");
            spriteBatch.Draw(texture, position, Color.White);
            spriteBatch.End();

            //if (!string.IsNullOrEmpty(text))
                //DrawText(spriteBatch, this.content.Load<SpriteFont>("SpriteFont1"), text);
        }

        private void DrawText(SpriteBatch spriteBatch, SpriteFont spriteFont, string text)
        {
            spriteBatch.Begin();

            // Find the center of the string
            Vector2 FontOrigin = spriteFont.MeasureString(text) / 2;
            Vector2 FontPos = new Vector2(this.position.X + (this.width / 2), this.position.Y + (this.height / 2));
            // Draw the string
            spriteBatch.DrawString(spriteFont, text, FontPos, Color.White, 0, FontOrigin, 1.0f, SpriteEffects.None, 0.5f);

            spriteBatch.End();
        }
    }
}
